//
//  AboutVC.m
//  Project
//
//  Created by 冯东辉 on 2018/9/28.
//  Copyright © 2018年 FengDongHui. All rights reserved.
//

#import "AboutVC.h"

@interface AboutVC ()

@property (nonatomic, strong) UIWebView *webView;

@property (nonatomic, strong) UIImageView *iconV;
@property (nonatomic, strong) UILabel *versionL;

@end

@implementation AboutVC

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    self.navTitleL.text = @"关于";
    [self createBlueNavigationBar:YES];
    
    [self creatWebView];
}

- (void)didReceiveMemoryWarning {
    
    [super didReceiveMemoryWarning];
}

- (void)creatWebView {
    
    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, SafeAreaTopHeight, GET_SCREEN_WIDTH(), GET_SCREEN_HEIGHT()-SafeAreaTopHeight)];
    
    self.webView.scrollView.bounces = NO;
    
    self.webView.backgroundColor = UICOLOR_HEX(0xffEDEEEF);
    
    NSString * path = [[NSBundle mainBundle] pathForResource:@"/assets/hunan/html/about.html" ofType:nil];
    
    NSURL *fileUrl = [[NSURL alloc] initWithString:path];
    
    NSURLRequest *request = [NSURLRequest requestWithURL:fileUrl];
    
    [self.webView loadRequest:request];
    
    [self.view addSubview:self.webView];
    
    NSString *app_Version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
    
    _iconV = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.webView.height-30, 20, 20)];
    _iconV.image = [UIImage imageNamed:@"about_icon"];
    [self.webView addSubview:_iconV];
    
    _versionL = [[UILabel alloc] initWithFrame:CGRectMake(_iconV.right+10, _iconV.top, 100, _iconV.height)];
    _versionL.text = [NSString stringWithFormat:@"V%@", app_Version];
    _versionL.textColor = UICOLOR_HEX(0xff666666);
    _versionL.font = [UIFont systemFontOfSize:18];
    [self.webView addSubview:_versionL];
    
    [_versionL sizeToFit];
    
    _iconV.frame = CGRectMake((GET_SCREEN_WIDTH()-_versionL.width-20-5)/2.0f, self.webView.height-30, 20, 20);
    _versionL.frame = CGRectMake(_iconV.right+10, _iconV.top, _versionL.width, _iconV.height);
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    
    
}

@end
